package algorithm;

/**
 * User: Asuka
 * Date: 11-3-1
 * Time: 下午10:49
 */
public class Division {

    public static void main(String[] args) {
        System.out.println(divide(6,6));
    }

    public static int divide(int num, int max) {
        if(num < 1 || max < 1) return 0;
        if(num == 1) return 1;
        if(num < max) return divide(num, num);
        if(num == max) return 1 + divide(num, num - 1);
        return divide(num, max - 1) + divide(num - max, max);
    }
}
